package com.senlingspace.payment.enums;

/**
 * 抖音核销类型
 *
 * @author lebronjames
 * @date 2024/07/24
 */
public enum DouyinUsedStatusTypeEnum {

    VERIFY_IN_SHOP(1, "到店核销"),

    GROUPON_SWITCH_DELIVERY(2, "团购转配送"),

    UNKNOWN(-1, "未知");

    private final int code;
    private final String desc;

    DouyinUsedStatusTypeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static DouyinUsedStatusTypeEnum getUsedStatusType(int code) {
        for (DouyinUsedStatusTypeEnum usedStatusType : DouyinUsedStatusTypeEnum.values()) {
            if (usedStatusType.getCode() == code) {
                return usedStatusType;
            }
        }
        return UNKNOWN;
    }
}
